if(!jsx3.lang.Class.forName("tibco.admin.enterpriseAssets.servers.ServerPlugin")) {

    /**
     * EnterpriseAssets
     */
    jsx3.lang.Package.definePackage("tibco.admin.enterpriseAssets.servers", function (eap) {
    });

    /**
     * EnterpriseAssets
     */
    jsx3.lang.Class.defineClass("tibco.admin.enterpriseAssets.servers.ServerPlugin",
            jsx3.lang.Object,
            [tibco.admin.enterpriseAssets.EnterpriseAssetsTabInterface, tibco.admin.plugin.PluginContainerInterface],
            function (plugin) {

                plugin.instance = null;
                plugin.prototype.tabsToLoad = new Object();
                plugin.prototype.allTabs = new Object();

                //plugin interface methods
                plugin.prototype.init = function() {
                    this.jsxsuper();
                }

                plugin.prototype.getNamespace = function() {
                    return "tibco.admin";
                }

                plugin.prototype.getSecondarySelectionText = function() {
                    return "";
                }

                plugin.prototype.destroyPlugin = function() {
                    var iter = this.getPluginList().iterator();
                    while(iter.hasNext()) {
                        iter.next().destroy();
                    }
                    this.getPluginList().clear();
                }

                plugin.getInstance = function(args) {
                    if(!this.instance) {
                        this.instance = new tibco.admin.enterpriseAssets.servers.ServerPlugin();
                    }
                    return this.instance;
                }

                plugin.prototype.getTabText = function() {
                    if(!tibco.admin.enterpriseAssets.servers.ServerPlugin.jssLoaded) {
                        tibco.admin.Main.loadResource("tibco/admin/enterpriseAssets/servers/jss/jss.xml", this.getNamespace(), null, "ljss");
                        tibco.admin.enterpriseAssets.servers.ServerPlugin.jssLoaded = true;
                    }
                    return tibco.admin.Main.getServer().getDynamicProperty("@@AdministrationServer_20")
                }

                plugin.prototype.getComponentPath = function() {
                    return  "tibco/admin/enterpriseAssets/servers/component.xml"
                }

                plugin.prototype.loadComponent = function(parent) {
                    var me = this;
                    tibco.admin.Main.loadUIResourceAsync(parent, "tibco.admin", "tibco/admin/enterpriseAssets/servers/components/servers.xml", me, me.loadMyDetails, true);
                }

                plugin.prototype.onAfterGetPlugins = function() {
                    this.buttonPane.subscribe(com.gix.gui.LeftSelectPane.BUTTON_SELECTED, this, this.loadButton);
                    var iter = this.getPluginList("tibco.admin.enterpriseAssets.EAS01").iterator();
                    if(iter.hasNext()) {
                        var tab = this.addTab(iter.next())
                        var parentPane = tab.getContentPane();
                        var lbl = tab.getText();
                        var plugInComponent = this.tabsToLoad[lbl];
                        if(plugInComponent) {
                            plugInComponent.loadComponent(parentPane);
                            delete this.tabsToLoad[lbl];
                        }
                    }
                    while(iter.hasNext()) {
                        this.addTab(iter.next())
                    }
                }

                plugin.prototype.addTab = function(pluginComponent) {
                    var labelText = pluginComponent.getLeftText();
                    var button = this.buttonPane.addButton(labelText);
                    this.tabsToLoad[labelText] = pluginComponent;
                    this.allTabs[labelText] = pluginComponent;
                    return button;
                }

                plugin.prototype.loadButton = function(objEvent) {
                    var parentPane = objEvent.target.getContentPane();
                    var lbl = objEvent.target.getText();
                    var plugInComponent = this.tabsToLoad[lbl];
                    if(plugInComponent) {
                        plugInComponent.loadComponent(parentPane);
                        delete this.tabsToLoad[lbl];
                    }
                    else {
                        plugInComponent = this.allTabs[lbl];
                        if(plugInComponent) {
                            setTimeout(function() {
                                plugInComponent.buttonSelected();
                            }, 0);
                        }
                    }
                }

                plugin.prototype.setupPlugin = function(obj) {
                }

                plugin.prototype.beginEdit = function(objPlugin) {
                    this.buttonPane.setSelectedEditMode(true);
                }

                plugin.prototype.endEdit = function(objPlugin) {
                    this.buttonPane.setSelectedEditMode(false);
                }

                plugin.prototype.initPlugin = function(obj) {
                }

                plugin.prototype.loadMyDetails = function(objEvent) {
                    if(objEvent.status == "SUCCESS") {
                        this.buttonPane = objEvent.obj;
                        if(this.getPluginList().size() == 0) {
                            var preLoad = new jsx3.util.List(0);
                            // load Machines tab
                            if(!tibco.admin.enterpriseAssets.servers.dbProps || !tibco.admin.enterpriseAssets.servers.dbProps.DbProperties) {
                                try {
                                    tibco.admin.Main.loadClass("tibco/admin/enterpriseAssets/servers/dbProps/DbProperties.js", "tibco.admin");
                                    preLoad.add(tibco.admin.enterpriseAssets.servers.dbProps.DbProperties, preLoad.size());
                                }
                                catch(ex) {
                                    tibco.admin.Main.logException(ex);
                                }
                            }
                            else {
                                preLoad.add(tibco.admin.enterpriseAssets.servers.dbProps.DbProperties, preLoad.size());
                            }

                            if(!tibco.admin.monitormanage || !tibco.admin.monitormanage.uicomponents || !tibco.admin.monitormanage.uicomponents.misc || !tibco.admin.monitormanage.uicomponents.misc.monitoringConfig || !tibco.admin.monitormanage.uicomponents.misc.monitoringConfig.MonitoringConfig) {
                                try {
                                    tibco.admin.Main.loadClass("tibco/admin/monitormanage/uicomponents/misc/monitoringConfig/MonitoringConfig.js", "tibco.admin");
                                    preLoad.add(tibco.admin.monitormanage.uicomponents.misc.monitoringConfig.MonitoringConfig, preLoad.size());
                                }
                                catch(ex) {
                                    tibco.admin.Main.logException(ex);
                                }
                            }
                            else {
                                preLoad.add(tibco.admin.monitormanage.uicomponents.misc.monitoringConfig.MonitoringConfig, preLoad.size());
                            }

                            //Tiger of Common Logging team insert following lines to embed the logging service configuration UI
                            if(!tibco.admin.enterpriseAssets.servers.loggingconfig || !tibco.admin.enterpriseAssets.servers.loggingconfig.LoggingConfig) {
                                try {
                                    tibco.admin.Main.loadClass("tibco/admin/enterpriseAssets/servers/loggingconfig/LoggingConfig.js", "tibco.admin");
                                    preLoad.add(tibco.admin.enterpriseAssets.servers.loggingconfig.LoggingConfig, preLoad.size());
                                }
                                catch(ex) {
                                    tibco.admin.Main.logException(ex);
                                }
                            }
                            else {
                                preLoad.add(tibco.admin.enterpriseAssets.servers.loggingconfig.LoggingConfig, preLoad.size());
                            }
                            //End of Tiger's modification

                            if(!tibco.admin.enterpriseAssets.servers.plugins || !tibco.admin.enterpriseAssets.servers.plugins.PluginsComponent) {
                                try {
                                    tibco.admin.Main.loadClass("tibco/admin/enterpriseAssets/servers/plugins/PluginsComponent.js", "tibco.admin");
                                    preLoad.add(tibco.admin.enterpriseAssets.servers.plugins.PluginsComponent, preLoad.size());
                                }
                                catch(ex) {
                                    tibco.admin.Main.logException(ex);
                                }
                            }
                            else {
                                preLoad.add(tibco.admin.enterpriseAssets.servers.plugins.PluginsComponent, preLoad.size());
                            }

                            if(!tibco.admin.enterpriseAssets.servers.nodes || !tibco.admin.enterpriseAssets.servers.nodes.Tabs) {
                                try {
                                    tibco.admin.Main.loadClass("tibco/admin/enterpriseAssets/servers/nodes/Tabs.js", "tibco.admin");
                                    preLoad.add(tibco.admin.enterpriseAssets.servers.nodes.Tabs, preLoad.size());
                                }
                                catch(ex) {
                                    tibco.admin.Main.logException(ex);
                                }
                            }
                            else {
                                preLoad.add(tibco.admin.enterpriseAssets.servers.nodes.Tabs, preLoad.size());
                            }

                            this.loadPlugins("tibco.admin.enterpriseAssets.servers.LeftNavInterface", preLoad);
                        }
                        else {
                            this.onAfterGetPlugins();
                        }
                    }
                    else {
                        if(objEvent.exception)
                        {
                            tibco.admin.Main.logException(objEvent.exception, objEvent.message);
                        }
                        else {
                            jsx3.log(objEvent.message);
                        }
                    }
                }

                plugin.prototype.tabSelected = function() {
                    var msg = new Object();
                    msg.subject = com.gix.gui.LeftSelectPane.BUTTON_SELECTED;
                    msg.target = this.buttonPane.getSelectedButton();
                    this.loadButton(msg);
                }
            })
            ;

}
